package br.ufrj.pesc.cassandra;

import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

import br.ufrj.pesc.solr.SearchSolrHandler;
import br.ufrj.pesc.thallesrsm.ISearchHandler;


public class ba {

	public static void main(String args[]){
		//SimpleCassandraClient bla = new SimpleCassandraClient();
		//bla.connect("192.168.8.182");
		ISearchHandler cassandraSearcher= new SearchCassandraHandler();
		Calendar calendario = Calendar.getInstance();
		Date data = new Date();
		calendario.setTime(data);
		calendario.set(2012,8,1,0,0,0);
		calendario.set(Calendar.MILLISECOND, 0);

		Calendar calendario2 = Calendar.getInstance();
		Date data2 = new Date();
		calendario2.setTime(data2);
		calendario2.clear();
		calendario2.set(2012,8,2,0,0,0);
		calendario2.set(Calendar.MILLISECOND, 0);

		List<String> fontes = new ArrayList<String>();
		fontes.add("twitter");
		fontes.add("facebook");

			System.out.println(cassandraSearcher.recuperaMencoes("lula", calendario.getTime(), calendario2.getTime(), fontes));
		
				
		ISearchHandler solrISearchHandler = null;
				try {
					solrISearchHandler = new SearchSolrHandler();
				} catch (MalformedURLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				System.out.println(solrISearchHandler.recuperaMencoes("lula", calendario.getTime(), calendario2.getTime(), fontes));


	}
}
